/**
 */
package org.cmoine.perspectiveshare.model.impl;

import java.util.Collection;

import org.cmoine.perspectiveshare.model.InfoType;
import org.cmoine.perspectiveshare.model.MainWindowType;
import org.cmoine.perspectiveshare.model.PerspectivesPackage;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Main Window Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.cmoine.perspectiveshare.model.impl.MainWindowTypeImpl#getInfo <em>Info</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class MainWindowTypeImpl extends EObjectImpl implements MainWindowType {
    /**
     * The cached value of the '{@link #getInfo() <em>Info</em>}' containment reference list.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getInfo()
     * @generated
     * @ordered
     */
    protected EList<InfoType> info;

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected MainWindowTypeImpl() {
        super();
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass() {
        return PerspectivesPackage.Literals.MAIN_WINDOW_TYPE;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public EList<InfoType> getInfo() {
        if (info == null) {
            info = new EObjectContainmentEList<InfoType>(InfoType.class, this, PerspectivesPackage.MAIN_WINDOW_TYPE__INFO);
        }
        return info;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case PerspectivesPackage.MAIN_WINDOW_TYPE__INFO:
                return ((InternalEList<?>)getInfo()).basicRemove(otherEnd, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case PerspectivesPackage.MAIN_WINDOW_TYPE__INFO:
                return getInfo();
        }
        return super.eGet(featureID, resolve, coreType);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @SuppressWarnings("unchecked")
    @Override
    public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case PerspectivesPackage.MAIN_WINDOW_TYPE__INFO:
                getInfo().clear();
                getInfo().addAll((Collection<? extends InfoType>)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset(int featureID) {
        switch (featureID) {
            case PerspectivesPackage.MAIN_WINDOW_TYPE__INFO:
                getInfo().clear();
                return;
        }
        super.eUnset(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case PerspectivesPackage.MAIN_WINDOW_TYPE__INFO:
                return info != null && !info.isEmpty();
        }
        return super.eIsSet(featureID);
    }

} //MainWindowTypeImpl
